]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/widget: Remove get_resource_scale function
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 28 May 2020 12:47:17 +0000 (14:47 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Tue, 30 Jun 2020 13:42:18 +0000 (13:42 +0000)
ClutterActor provides the same function, but with a different return
value. So since we already switched to the ClutterActor implementation
in our C code, we can now safely remove st_widget_get_resource_scale()
and update the JS code that's still using the old API.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1287

js/gdm/loginDialog.js
js/ui/animation.js
src/st/st-widget.c
src/st/st-widget.h

index 4246b8616f3c4cb0eb3699679c87d220620dd5bf..46ddc51f57637dc81e720f6f0ff67f0011828edf 100644 (file)
@@ -810,8 +810,8 @@ var LoginDialog = GObject.registerClass({
             return;
 
         this._logoBin.destroy_all_children();
-        const [valid, resourceScale] = this._logoBin.get_resource_scale();
-        if (this._logoFile && valid) {
+        const resourceScale = this._logoBin.get_resource_scale();
+        if (this._logoFile) {
             let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
             this._logoBin.add_child(this._textureCache.load_file_async(this._logoFile,
                                                                        -1, -1,
index fa8cad932acf42c7d8b1f02f0cf2abd8bcfa3338..5cb3a83c130ade9f8edb28a93495f7370c45b218 100644 (file)
@@ -60,7 +60,7 @@ class Animation extends St.Bin {
     }
 
     _loadFile(file, width, height) {
-        let [validResourceScale, resourceScale] = this.get_resource_scale();
+        const resourceScale = this.get_resource_scale();
         let wasPlaying = this._isPlaying;
 
         if (this._isPlaying)
@@ -69,12 +69,6 @@ class Animation extends St.Bin {
         this._isLoaded = false;
         this.destroy_all_children();
 
-        if (!validResourceScale) {
-            if (wasPlaying)
-                this.play();
-            return;
-        }
-
         let textureCache = St.TextureCache.get_default();
         let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
         this._animations = textureCache.load_sliced_image(file, width, height,
index c8bc9edef026fe1da91e4a9b7b27a77b7952b0d0..6fd7a11a9d04adefc2b096cb34298a87263ef7c0 100644 (file)
@@ -1399,25 +1399,6 @@ st_widget_get_style (StWidget *actor)
   return ST_WIDGET_PRIVATE (actor)->inline_style;
 }
 
-/**
- * st_widget_get_resource_scale:
- * @widget: A #StWidget
- * @resource_scale: (out): return location for the resource scale
- *
- * Retrieves the resource scale for this #StWidget, if available.
- *
- * The resource scale refers to the scale the actor should use for its resources.
- */
-gboolean
-st_widget_get_resource_scale (StWidget *widget,
-                              float    *resource_scale)
-{
-  if (resource_scale)
-    *resource_scale = clutter_actor_get_resource_scale (CLUTTER_ACTOR (widget));
-
-  return TRUE;
-}
-
 static void
 st_widget_set_first_visible_child (StWidget     *widget,
                                    ClutterActor *actor)
index 99644d7864d5e3e9c938d896f82bec56fac72495..9a4d28fb18fba21620d9f1d583ff40a3264f7488 100644 (file)
@@ -134,8 +134,6 @@ StThemeNode *         st_widget_peek_theme_node           (StWidget        *widg
 GList *               st_widget_get_focus_chain           (StWidget        *widget);
 void                  st_widget_paint_background          (StWidget            *widget,
                                                            ClutterPaintContext *paint_context);
-gboolean              st_widget_get_resource_scale        (StWidget        *widget,
-                                                           float           *resource_scale);
 
 /* debug methods */
 char  *st_describe_actor       (ClutterActor *actor);